import { defineConfig } from 'vite';
import uni from '@dcloudio/vite-plugin-uni';

export default defineConfig({
  plugins: [uni()],
  server: {
    proxy: {
      '/baidu': {
        target: 'https://api.e-ky.cn/baidubce', // 替换为你的目标服务器
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ''), // 移除 /api 前缀
      },
      '/api': {
        target: 'https://api.e-ky.cn',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/app/, ''),
      }
    }
  }
});